package com.cloudcc.frame.Interface;

import cn.hutool.system.UserInfo;
import com.cloudcc.deveditor.core.ServiceResult;
import com.cloudcc.deveditor.trigger.TriggerEditor;
import com.cloudcc.frame.comclass.SaveAccount;
import com.cloudcc.frame.comclass.SaveAccountTest;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class saveAccount extends TriggerEditor {

    public void a(UserInfo userInfo, HttpServletRequest request) throws Exception {
        /*开函客户的阶段变为 	转换成功 ,  给项目经理发送通知， 商机的升迁 ， 开函数据的储存   客户的修改为电子保函客户 */
        //这是一个Site页面，可以通过URL直接访问 上面是测试环境
        //   ServiceResult sr = CCService.getUserInfo("61ee0c8c32fe6ea38850a3475fa15750fbc1bb1a20768b71", "test_hhtest@cloudcc.com", "111111");

        // ServiceResult sr = CCService.getUserInfo("f6c729c175119d3aa2942d814a63df8564dfe85e8959db2d","interface@cloudcc.com","111111");
        //  UserInfo uuserInfo = (UserInfo) sr.get("COMMON_USERINFO");
        String type = request.getParameter("type") == null ? "" : request.getParameter("type") + "";

        String msg ="";
        SaveAccountTest saveAccount = new SaveAccountTest();
        if (type.equals("accountSource")) {
            String s = saveAccount.accountSource();
            msg =s;
        } else if (type.equals("picklistValue")) {
            msg = saveAccount.picklistValue();

        } else if (type.equals("pickEleOpenInfoValue")) {
            msg = saveAccount.pickEleOpenInfoValue();

        } else if (type.equals("pickEleOpenCircleInfo")) {
            msg = saveAccount.pickEleOpenCircleInfo();

        } else if (type.equals("pickEleOpenMainAreaInfo")) {
            msg = saveAccount.pickEleOpenMainAreaInfo();

        } else if (type.equals("peleNumInfo")) {
            msg = saveAccount.peleNumInfo();

        }  else if (type.equals("findProvinceCityInfo")) {
            msg = saveAccount.findProvinceCityInfo();

        } else if (type.equals("findAccount")) {
            msg = saveAccount.findAccount();

        } else if (type.equals("findUser")) {
            msg = saveAccount.findUser();

        } else if (type.equals("findpsmcInfo")) {
            msg = saveAccount.findpsmcInfo();

        } else if (type.equals("systemInfo")) {
            msg = saveAccount.systemInfo();

        } else if (type.equals("findEleNum")) {
            msg = saveAccount.findEleNum();

        }else if (type.equals("regeo")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.regeo(data);
        }else if (type.equals("gen")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.gen(data);
        }else if (type.equals("findMapCityInfo")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.findMapCityInfo(data);
        }else if (type.equals("findLikeAccount")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.findAccount(data);
        }else if (type.equals("findLikeUser")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.findUser(data);
        }else if (type.equals("postQuerystatus")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.postQuerystatus(data);
        }else if (type.equals("findAccountRetrieve")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.findAccountRetrieve(data);
        }else if (type.equals("sharedAccount")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.sharedAccount(data);
        }else if (type.equals("receiveAccount")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.receiveAccount(data);
        }else if (type.equals("saveAccount")){
            String data =request.getParameter("data")==null?"":request.getParameter("data");
            msg = saveAccount.saveAccount(data);
        }
        request.setAttribute("jsonmsg", msg);
    }
}
